'''
线性模型
model:
        class: LinearModel
        module_path: qlib.contrib.model.linear
        kwargs:
            estimator: ols
'''


def load_linear_model():
    from qlib.contrib.model.linear import LinearModel
    model = LinearModel()
    return model


'''
XGBoost
 model:
        class: XGBModel
        module_path: qlib.contrib.model.xgboost
        kwargs:
            eval_metric: rmse
            colsample_bytree: 0.8879
            eta: 0.0421
            max_depth: 8
            n_estimators: 647
            subsample: 0.8789
            nthread: 20
'''


def load_xgboost():
    from qlib.contrib.model.xgboost import XGBModel
    config = {
        'eval_metric': 'rmse',
        'colsample_bytree': 0.8879,
        'eta': 0.0421,
        'max_depth': 8,
        'n_estimators': 647,
        'subsample': 0.8789,
        'nthread': 20
    }
    model = XGBModel(**config)
    return model
